/*
 * GUIInit.cpp
 *
 *  Created on: 01.12.2011
 *      Author: Andrey Efimov
 *      Copyright: LGPL
 */

#ifndef _GUIBASE_H_
#define _GUIBASE_H_

#include <stdio.h>
#include <string>
#include "../StructSource.h"
#include "../BasicTypes.h"


//---------------------------------------------------
enum ECheckMouse
{
	CM_FALSE,
	CM_MOUSEDOWN,
	CM_MOUSEMOVE
};
//---------------------------------------------------
class CGuiBase
{
private:
	bool Visible;
	bool Enable;
	glm::vec2 Position;
	glm::vec2 Size;
	std::string Name;
	std::string Cursor;
	ECheckMouse CheckMouse;
	UINT Texture1;
	UINT Texture2;
	UINT Texture3;
	UINT Texture4;
	UINT Texture5;
	friend class CShablon;
public:
	CGuiBase();

	virtual bool		GetVisible() const { return Visible; };
	virtual bool		GetEnable() const { return Enable; };
	virtual glm::vec2	GetPosition() const { return Position; };
	virtual glm::vec2	GetSize() const { return Size; };
	virtual std::string	GetName() const { return Name; };
	virtual std::string	GetCursor() const { return Cursor; };
	virtual ECheckMouse	GetCheckMouse() const { return CheckMouse; };
	virtual UINT		GetTexture1() const { return Texture1; };
	virtual UINT		GetTexture2() const { return Texture2; };
	virtual UINT		GetTexture3() const { return Texture3; };
	virtual UINT		GetTexture4() const { return Texture4; };
	virtual UINT		GetTexture5() const { return Texture5; };

	virtual void		SetVisible( const bool values) { Visible = values; };
	virtual void		SetEnable( const bool values) { Enable = values; };
	virtual void		SetPosition(glm::vec2 values) { Position.x = values.x; Position.y = values.y; };
	virtual void		SetName(std::string values) { Name = values; };
	virtual void		SetCursor(std::string values) { Cursor = values; };
	virtual void		SetCheckMouse(ECheckMouse values) { CheckMouse = values; };

	//----����������----
	virtual std::string	GetText() { return NULL; };
	virtual std::string	GetItems() { return NULL; };
	virtual int			GetItemIndex() { return 0; };
	virtual bool		GetScrollBars() { return false; };
	virtual bool		GetChecked() { return false; };
	virtual int			GetGroup() { return 0; };
	virtual int			GetMin() { return 0; };
	virtual int			GetMax() { return 0; };
	virtual int			GetValue() { return 0; };

	virtual bool		SetText(std::string values) { return false; };
	virtual bool		SetItems(std::string values) { return false; };
	virtual bool		SetItemIndex(int values) { return false; };
	virtual bool		SetScrollBars(bool values) { return false; };
	virtual bool		SetChecked(bool values) { return false; };
	virtual bool		SetGroup(int values) { return false; };
	virtual bool		SetMin(int values) { return false; };
	virtual bool		SetMax(int values) { return false; };
	virtual bool		SetValue(int values) { return false; };

	virtual GUI_ELEMENT* onDraw() = 0;
	virtual void onClick() = 0;
	virtual void onMouseDown() = 0;
	virtual void onMouseMove() = 0;
	virtual void onMouseUp() = 0;
	virtual void onKeyPress() = 0;
};
//---------------------------------------------------
class CLabel: public CGuiBase
{
private:
	std::string Text;
public:
	CLabel();
	
	std::string	GetText() { return Text; };
	bool		SetText(std::string values) { Text = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CEdit: public CGuiBase
{
private:
	std::string Text;
public:
	CEdit();

	std::string	GetText() { return Text; };
	bool		SetText(std::string values) { Text = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CMemo: public CGuiBase
{
private:
	std::string Text;
	bool ScrollBars;
public:
	CMemo();

	std::string	GetText() { return Text; };
	bool		GetScrollBars() { return ScrollBars; };
	bool		SetText(std::string values) { Text = values; return true; };
	bool		SetScrollBars(bool values) { ScrollBars = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CListBox: public CGuiBase
{
private:
	std::string Items;
	int ItemIndex;
	bool ScrollBars;
public:
	CListBox();

	std::string	GetItems() { return Items; };
	int			GetItemIndex() { return ItemIndex; };
	bool		GetScrollBars() { return ScrollBars; };
	bool		SetItems(std::string values) { Items = values; return true; };
	bool		SetItemIndex(int values) { ItemIndex = values; return true; };
	bool		SetScrollBars(bool values) { ScrollBars = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CComboBox: public CGuiBase
{
private:
	std::string Items;
	int ItemIndex;
	bool ScrollBars;
public:
	CComboBox();

	std::string	GetItems() { return Items; };
	int			GetItemIndex() { return ItemIndex; };
	bool		GetScrollBars() { return ScrollBars; };
	bool		SetItems(std::string values) { Items = values; return true; };
	bool		SetItemIndex(int values) { ItemIndex = values; return true; };
	bool		SetScrollBars(bool values) { ScrollBars = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CButton: public CGuiBase
{
private:
	std::string Text;
public:
	CButton();

	std::string	GetText() { return Text; };
	bool		SetText(char* values) { Text = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CCheckBox: public CGuiBase
{
private:
	std::string Text;
	bool Checked;
public:
	CCheckBox();

	std::string	GetText() { return Text; };
	bool		GetChecked() { return Checked; };
	bool		SetText(std::string values) { Text = values; return true; };
	bool		SetChecked(bool values) { Checked = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick();
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CRadioButton: public CGuiBase
{
private:
	std::string Text;
	bool Checked;
	int Group;
public:

	CRadioButton();

	std::string	GetText() { return Text; };
	bool		GetChecked() { return Checked; };
	int			GetGroup() { return Group; };
	bool		SetText(std::string values) { Text = values; return true; };
	bool		SetChecked(bool values) { Checked = values; return true; };
	bool		SetGroup(int values) { Group = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick();
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CProgressBar: public CGuiBase
{
private:
	int Min;
	int Max;
	int Value;
public:
	CProgressBar();

	int		GetMin() { return Min; };
	int		GetMax() { return Max; };
	int		GetValue() { return Value; };
	bool	SetMin(int values) { Min = values; return true; };
	bool	SetMax(int values) { Max = values; return true; };
	bool	SetValue(int values) { Value = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CTrackBar: public CGuiBase
{
private:
	int Min;
	int Max;
	int Value;
public:
	CTrackBar();

	int		GetMin() { return Min; };
	int		GetMax() { return Max; };
	int		GetValue() { return Value; };
	bool	SetMin(int values) { Min = values; return true; };
	bool	SetMax(int values) { Max = values; return true; };
	bool	SetValue(int values) { Value = values; return true; };

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CPanel: public CGuiBase
{
public:

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};
//---------------------------------------------------
class CInventar: public CGuiBase
{
public:

	GUI_ELEMENT* onDraw();
	void onClick(){};
	void onMouseDown(){};
	void onMouseMove(){};
	void onMouseUp(){};
	void onKeyPress(){};
};

#endif
